
function tryToBuy(goodsName, goodsID, goodsPrice) {
	var ua = navigator.userAgent.toLowerCase();
	if(/iphone|ipad|ipod/.test(ua)) {
		var url = 'buy://?';
		var paramas = goodsName + '&' + goodsID + '&' + goodsPrice;

		window.location.href = url + encodeURIComponent(paramas);
	} else if(/android/.test(ua)) {

	}
}

function returnHome() {
	var ua = navigator.userAgent.toLowerCase();
	if(/iphone|ipad|ipod/.test(ua)) {
		var url = 'return://?';
		window.location.href = url;
	} else if(/android/.test(ua)) {
		var url = 'javascript:bbt.returnHome()';
		window.location.href = url;
	}
}

$("document").ready(function() {
	//获得slider插件对象
	var gallery = mui('.mui-slider');
	gallery.slider({
		interval: 3000 //自动轮播周期，若为0则不自动播放，默认为0；
	});
	//点击弹出浮层(没有show这个id的不用弹)
	$(".show").click(function() {
		$("#fullScreen").show();
		$("#floatLayer").animate({
			bottom: '0px'
		},100);
		
		//隐藏浮层
		$("#hide").click(function() {
			$("#fullScreen").hide();
			var _height = $("#floatLayer").height();
//			alert(_height);
			$("#floatLayer").animate({
				bottom: -_height+"px"
			},100);
		});
		//隐藏浮层
		$("#fullScreen").click(function() {
			$("#fullScreen").hide();
			var _height = $("#floatLayer").height();
			$("#floatLayer").animate({
				bottom: -_height+"px"
			},100);
		});
	});
});